﻿using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using System.Net;
using System.IO;

namespace DllSync.Tests
{
	public class DeployUriFixture
	{
		[Fact]
		public void ParsesDeployUri()
		{
			var uri = new Uri("http://build.moq.me/index.html#Moq-{mayor}.{minor}.{build}.{revision}-bin.zip");

			var frag = uri.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);

			Console.WriteLine(uri);
		}

		[Fact]
		public void ContentType()
		{
			var v = new Version("2.5");
			Console.WriteLine(v);

			v = new Version("2.99.1");
			Console.WriteLine(v);

			v = new Version("2.123132414.13211231.1231324");
			Console.WriteLine(v);

			var request = WebRequest.Create("file://" + new FileInfo("SampleDeploy.xml").FullName);
			using (var response = request.GetResponse())
			{
				Console.WriteLine(response.ContentType);
			}
		}
	}
}
